<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>修改</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
    {include file='public/head.html'}
</head>
<body class="childrenBody {:dialog_css()}">

<form class="layui-form" action="{:url('edit')}" method="post">
    <input type="hidden" name="id" value="{$vo.id}"/>

    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">模型名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" placeholder="模型名称" value="{$vo.title}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">表名(标识)</label>
        <div class="layui-input-block">
            <input type="text" name="table_name" lay-verify="required" placeholder="表名(不包含前缀)" value="{$vo.table_name}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">表注释</label>
        <div class="layui-input-block">
            <input type="text" name="table_comment" lay-verify="required" placeholder="表注释" value="{$vo.table_comment}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">表主键</label>
        <div class="layui-input-block">
            <input type="text" name="table_primary" value="{$vo.table_primary}" placeholder="表主键，多个用,分割" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">列表排序</label>
        <div class="layui-input-block">
            <input type="text" name="list_order" lay-verify="required" placeholder="数据排序设置" value="{$vo.list_order}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">每页条数</label>
        <div class="layui-input-block">
            <input type="number" name="list_limit" value="{$vo.list_limit}" min="0" step="10" lay-affix="number" placeholder="分页条数，0为全部" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">列表排除</label>
        <div class="layui-input-block">
            <input type="text" name="list_except" lay-verify="required" placeholder="列表排除字段，多个用,分隔" value="{$vo.list_except}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">表单搜索</label>
        <div class="layui-input-inline w100">
            <input type="hidden" name="form_search" value="0">
            <input type="checkbox" name="form_search" value="1" lay-skin="switch" lay-text="开启|关闭" {if $vo['form_search']==1:}checked="checked"{/if}/>
        </div>
        <div class="layui-form-mid">搜索框</div>
        <div class="layui-input-inline w100">
            <input type="hidden" name="form_visible" value="0">
            <input type="checkbox" name="form_visible" value="1" lay-skin="switch" lay-text="可见|隐藏" {if $vo['form_visible']==1:}checked="checked"{/if}/>
        </div>
        <div class="layui-form-mid"> 切换按钮</div>
        <div class="layui-input-inline w100">
            <input type="hidden" name="form_toggle" value="0">
            <input type="checkbox" name="form_toggle" value="1" lay-skin="switch" lay-text="显示|隐藏" {if $vo['form_toggle']==1:}checked="checked"{/if}/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">URL条件</label>
        <div class="layui-input-group">
            <input type="hidden" name="url_search" value="0">
            <input type="checkbox" name="url_search" value="1" lay-skin="switch" lay-text="开启|关闭" {if $vo['url_search']==1:}checked="checked"{/if}/>
            <div class="layui-input-suffix"> URL参数搜索，如：id=1&type=image</div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">快搜设置</label>
        <div class="layui-input-block">
            <input type="text" name="quick_search" placeholder="如：title|name@like#搜索" value="{$vo.quick_search}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                修改
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>

<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['aphpForm', 'aphp', 'form'], function () {
        var aphpForm = layui.aphpForm,
            aphp = layui.aphp,
            form = layui.form;

        //aphpForm.bindEvent('form.layui-form'); // 渲染表单

        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 0, function () {
                parent.layer.close(parent.layer.getFrameIndex(window.name));
                parent.layui.table.reload('currentTable');
            });
            return false;
        });
    })
</script>
</body>
</html>